<!DOCTYPE html>
<html>
<head>
  <title>找回密码 - 里客云</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../../css/bootstrap.min.css">
  <script src="../../js/jquery-3.4.1.min.js"></script>
  <style type="text/css">
    .container{
      width: 90%;
      margin-top: 50px;
    }
    h3{
      text-align: center;
      margin-bottom: 30px;
      color: #666;
    }
    .container .jumbotron{
      padding: 20px 30px;
    }
    .container .jumbotron .form-control{
      height: 50px;
      margin-top: -10px;
    }
    .container .jumbotron .btn-dark{
      height: 45px;
      display: block;
      width: 160px;
      margin:20px auto 0;
    }
    .container .jumbotron .tips{
      text-align: center;
      color: #666;
      margin-top: 20px;
      font-size: 17px;
    }
    .container .jumbotron .tips a{
      text-decoration: none;
      color: #666;
    }
    .container .jumbotron .rg{
      text-align: center;
      color: #666;
      margin-top: 20px;
      font-size: 17px;
    }
    .container .jumbotron .rg a{
      text-decoration: none;
      color: #666;
    }
    .container .Result{
      width: 100%;
      height: 50px;
      display: none;
      margin-top: -10px;
    }
    /*去掉输入框黄色背景*/
    input:-webkit-autofill, 
    input[type=text]:focus, input[type=password]:focus, textarea:focus {
      -webkit-box-shadow: 0 0 0 1000px white inset; 
    }
    .container .jumbotron .wxlogin{
      width: 40px;
      height: 40px;
      margin:10px auto;
    }
    .container .jumbotron .wxlogin img{
      width: 40px;
      height: 40px;
      border-radius: 100%;
    }
  </style>
</head>
<body>

<div class="container">
  <div class="jumbotron">
    <h3>找回密码</h3>
    <form onsubmit="return false" id="fpwdcheck">
      <div class="input-group mb-3">
        <input type="text" class="form-control" placeholder="请输入里客云账号" name="user">
      </div>
      <div class="input-group mb-3">
        <input type="email" class="form-control" placeholder="请输入邮箱" name="email">
      </div>
      <!-- 登陆按钮 -->
      <button type="submit" class="btn btn-dark" onclick="fpwdcheck();">尝试找回密码</button>
    </form>
    <!-- TIPS -->
    <p class="tips"><a href="../reg">注册账号</a>&nbsp;&nbsp;&nbsp;<a href="../login">登陆账号</a></p>
    <!-- 人工找回 -->
    <p class="rg" onclick="rg();">人工找回密码</p>
  </div>

  <!-- 反馈 -->
  <div class="Result"></div>
</div>

<!-- ajax验证账号 -->
<script>
function fpwdcheck(){
  $.ajax({
      type: "POST",
      url: "./fpwdcheck.php",
      data: $('#fpwdcheck').serialize(),
      success:function(data){
        // 验证成功
        if (data.code == 100) {
          $(".container .Result").css("display","block");
          $(".container .Result").html('<div class="alert alert-success"><strong>'+data.msg+'</strong></div>');
        }else{
          // 验证失败
          $(".container .Result").css("display","block");
          $(".container .Result").html('<div class="alert alert-danger"><strong>'+data.msg+'</strong></div>');
        }
      },
      error:function(data) {
        // 服务器发生错误
        $(".container .Result").css("display","block");
        $(".container .Result").html("<div class=\"alert alert-danger\"><strong>服务器发生错误</strong></div>");
      }
  });
}

function rg(){
  alert("请发送你注册账号时填写的相关信息，便于人工查询。例如【手机号、邮箱、账号等】到邮箱674473215@qq.com，等待人工处理完毕后会通过邮箱回复你。");
}
</script>
</body>
</html>